<template>
    <div>
        <van-form @submit="onSubmit">
            <van-cell-group inset>
                <van-field v-model="username" name="username"  placeholder="请输入手机号"
                    :rules="[{ required: true, message: '请填写用户名' }]"  class="a"/>
                    <input type="text" class="ys"><button>获取验证码</button>
                <van-field v-model="password" type="password" name="password"  placeholder="密码"
                    :rules="[{ required: true, message: '请输入密码' }]" class="b"/>
            </van-cell-group>
            <div style="margin: 16px;">
                <van-button round block type="primary" native-type="submit">
                    登录
                </van-button>
            </div>
        </van-form>
    </div>
</template>

<script setup>
import { ref } from 'vue';
import { useRouter } from 'vue-router';
let username = ref('')
let password = ref('')
let router = new useRouter()
const onSubmit = ()=>{
    if(username.value == '17303343243' && password.value == '123456'){
        localStorage.setItem('token','dawkdalwdjlawdsldwljdalwkdjwaldkjwl')
        router.push('/')
    }
}
</script>

<style>
.ys{
    border: none;
    border-bottom: 1px solid #000;
    margin-left: 10px;
    margin-top: 30px;
}
.a{
    border-bottom: 1px solid #000;
}
.b{
    border-bottom: 1px solid #000;
}
</style>